#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "../memory.hpp"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ui->label->setPixmap(QPixmap(1280/2,1280/2));
    QPixmap pmap = QPixmap(*(ui->label->pixmap()));
    QImage image = pmap.toImage();
    for(uint16_t i=MEM_SIZE/4*3;i!=0;i++)
       GM.wb(i,i*101);
    Memory * lm = &GM;
    for(int x=0;x<128;x++)
        for(int y=0;y<128;y++)
        {
            uint v = GM.rb(MEM_SIZE/4*3 + (x*128+y));
            for(int i=0;i<5;i++)
                for(int j=0;j<5;j++)
                    image.setPixel(5*x+i,5*y+j,v);
        }
    pmap.convertFromImage(image);
    ui->label->setPixmap(pmap);
    ui->label->show();
}

MainWindow::~MainWindow()
{
    delete ui;
}
